decode handles partial data with null data and errors